home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / crue1gen.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-30  |  738 b   |  27 lines

  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <ctype.h>
  4. #include <fstream.h>
  5.  
  6. void main()
  7. {
  8.     char name[10];              // special note: Even though you said that you need cout to display numbers, I discovered that's not true and you can with printf because I made a smaller version of the other program using printf...U just need to use %d rather than %s/
  9.     int sum,length,i,xored,serial;
  10.  
  11.     printf("Enter your name (max 10, NO Spaces, ?'s, !'s, etc...letters only):");
  12.     gets(name);
  13. length = strlen(name);
  14.     for (i=0; i<length; i++)
  15.     {
  16.         name[i] = toupper(name[i]);
  17.     }
  18.     sum=name[0];
  19.     for (i=1; i<length; i++)
  20.     {
  21.         sum=sum+name[i];
  22.     }
  23.     xored=sum^22136;
  24.     serial=xored^4660;
  25.     printf("Your serial is %i.",serial);
  26. }
  27.